package com.example.demo.controller;

import com.example.demo.service.IUserService;
import com.example.demo.vo.Email;
import com.example.demo.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户接口
 */
@RestController
public class UserController {

    @Autowired
    private IUserService userService;

    /**
     * 邮箱验证码注册
     * @return R
     */
    @GetMapping("/register")
//    @Async
    public R register(String[] mail) {
        userService.sendEmail01(new Email(mail, "[A子辰] 请验证您的电子邮件地址。", ""));
        return R.ok();
    }

}
